package lis.r3.wyd2;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class NSLookupFull {

	public static void main(String[] args) {

		InetAddress[] ips = null;
		String host = null;
		
		while (true) {
			System.out.println("\nHost:");
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			try {
				host = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			try {
				ips = InetAddress.getAllByName(host);
			} catch (UnknownHostException e) {
				System.out.println("Nie odnaleziono hosta");
				e.printStackTrace();
			}
//			for (int i = 0; i < ips.length; i++) {
//				System.out.println(ips[i].getHostName() + " : " + ips[i].getHostAddress());
//			}
			for (InetAddress e : ips) {
				System.out.println(e.getHostAddress());
			}
		}
	}

}
